import {get, post } from '@/utils/request'
// =================== 监控调取申请
// 判断是否进行实名认证  /wx/auth

// 获取用户信息  /wx/info
export const getUserInfo = (data) => {
    return get('/wx/info', data)
}

//  登录 /app/auth/h5Login
export const h5Login = (data) => {
    return post('/app/auth/h5Login', data, {
        'Content-Type': 'multipart/form-data' // hearder 很重要，Content-Type 要写对
    })
}

// 静默登录 /app/h5/silentLogin
export const silentLogin = (data) => {
    return post('/app/h5/silentLogin', data, {
        'Content-Type': 'multipart/form-data'
    })
}

// 获取用户详细信息 /app/h5/getUserInfo
export const getUserDetailInfo = (data) => {
    return post('/app/h5/getUserInfo', data, {
        'Content-Type': 'multipart/form-data'
    })
}

// 检查用户信息完整性 /app/h5/checkUserInfo
export const checkUserInfo = (openId) => {
    return get(`/app/h5/checkUserInfo?openId=${openId}`)
}

// 生成微信授权URL /app/h5/oauth2Url
export const generateOAuth2Url = (redirectUri, scope = 'snsapi_base', state = '') => {
        return get(`/app/h5/oauth2Url?redirectUri=${encodeURIComponent(redirectUri)}&scope=${scope}&state=${state}`)
    }
    // 获取礼物列表请求  /vote/gift/activity/{activityId}/list
export const activitylist = (activityId) => {
    return get(`/vote/gift/activity/list/${activityId}`)
}

// 发表感言 /lzmarathonsys/tbpersonclockin/save
export const submitSpeech = (data) => {
    return post('/lzmarathonsys/tbpersonclockin/save', data, {
        'Content-Type': 'multipart/form-data' // hearder 很重要，Content-Type 要写对
    })
}

//获取打卡评论列表
export const getClockComment = (data) => {
    return get(`/lzmarathonsys/tbcomment/getComment?tbTargetId=${data.id}&type=${data.type}`)
}

// 活动信息 /app/vote-activity/detail/${activityId}
export const activeInfo = (activityId) => {
    return get(`/app/vote-activity/detail/${activityId}`)
}


//选手列表  GET /app/vote-participant/list/{activityId}
// 8663156af9e84cce9b93e129dc0c03ce  0902测试 别删  3
// i/app/vote-participant/list/{{activityId}}
export const playerList = (activityId, data) => {
    return get(`/app/vote-participant/list/${activityId}`, data)
}

// 选手图片 http://localhost:5568/platform-api/app/vote-participant/uploadImage
export const apiUploadImage = (data) => {
    return post('/app/vote-participant/uploadImage', data, {
        'Content-Type': 'multipart/form-data' // hearder 很重要，Content-Type 要写对
    })
}

//票数排行榜 http://localhost:5568/platform-api
export const rankList = (activityId, data) => {
    return get(`/admin/vote-stats/overview/${activityId}`, data)
}

//选手报名 
export const addPlayer = (data) => {
    return post(`/app/vote-participant/h5add`, data)
}

// 免费投票 /app/vote-record/vote 
export const getVoteing = (data) => {
    return post(`/app/vote-record/buyVote`, data)
}

//投票纪录/app/vote-record/participant/{{participantId}}
export const getVoteRecords = (participantId, data) => {
    return get(`/app/vote-record/participant/${participantId}`, data)
}

//浏览量 /app/vote-participant/detail/

export const getPlayerDetail = (participantId) => {
    return get(`/app/vote-participant/detail/${participantId}`)
}